/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gestionmagasins_aspectj_junit_patterns.model;

import java.util.ArrayList;

/**
 *
 * @author Michael
 */
public abstract class Article {
    
    protected int id;
    protected String codeArticle;
    protected String nom;
    protected String description;
    protected Taille taille;
    protected double prix;
    protected int quantiteEnInventaire;
    protected ArrayList<Taxe> taxes;
    
    public int getId() {
        return id;
    }

    public String getCodeArticle() {
        return codeArticle;
    }
    public void setCodeArticle(String codeArticle) {
        this.codeArticle = codeArticle;
    }

    public String getNom() {
        return nom;
    }
    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }

    public Taille getTaille() {
        return taille;
    }
    public void setTaille(Taille taille) {
        this.taille = taille;
    }

    public double getPrix() {
        return prix;
    }
    public void setPrix(double prix) {
        this.prix = prix;
    }
    
    public int getQuantiteEnInventaire(){
        return quantiteEnInventaire;
    }
    public void setQuantiteEnInventaire(int quantiteEnInventaire){
        this.quantiteEnInventaire = quantiteEnInventaire;
    }
    
    public boolean estDisponible(){
        return (quantiteEnInventaire > 0);
    }

    public ArrayList<Taxe> getTaxes(){
    
    return (ArrayList<Taxe>)taxes.clone();
}
            
    public void addTaxe(Taxe taxe){
        
        taxes.add(taxe);
    }
    
    public void clearTaxes(){
        
        taxes.clear();
    }
    
    @Override
    public String toString() {
        return codeArticle.toString();
    }
    
}
